﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using Core.Exceptions;
using Core.Extensions;

namespace Core
{
    public abstract class Line
    {
        public int Number { get; set; }
        public int ThreadId { get; set; }
        public DateTime TimeStamp { get; set; }
        public String Text { get; set; }

        protected String rawLine;

        protected abstract void Parse(String[] columns);
        public abstract void Chain(Chainer chainer);

        public Line(String rawLine, String[] columns)
        {
            if (String.IsNullOrWhiteSpace(rawLine))
                throw new LineIsEmptyException();
            this.rawLine = rawLine;

            Parse(columns);
        }

        public override string ToString()
        {
            return rawLine;
        }
    }
}